/*
 *
 *
 */

#ifndef WINDOW_INPUT_H
#define WINDOW_INPUT_H

#include "gkt_date_time.h"

#ifdef __cplusplus
extern "C" {
#endif

enum {
	WINDOW_INPUT_COMPLETE = 0,
	WINDOW_INPUT_CANCELLED,
	WINDOW_INPUT_MAX
};

enum {
	WINDOW_INPUT_NUMBER_VALUE = 0,	/* decimal value */
	WINDOW_INPUT_NUMBER_DIGITS,	/* ascii digits */
	WINDOW_INPUT_NUMBER_MAX
};

enum {
	WINDOW_INPUT_REGULAR_FONT = 0,
	WINDOW_INPUT_BIG_FONT,
	WINDOW_INPUT_FONT_MAX
};
	
typedef struct {
	uint32_t	value_min;	/* [input] */
	uint32_t	value_max;	/* [input] */
	uint32_t	value;		/* [output] */
} window_input_value_s;

#ifdef GKT_CONFIG_WINDOW_INPUT_DIGITS_MAX
#define WINDOW_INPUT_DIGITS_MAX	GKT_CONFIG_WINDOW_INPUT_DIGITS_MAX
#else
#define WINDOW_INPUT_DIGITS_MAX	16
#endif
typedef struct {
	uint8_t	digits_min;	/* [input] */
	uint8_t	digits_max;	/* [input] */
	uint8_t	digits;		/* [output] real digits, e.g: 8 */
	uint8_t		data[WINDOW_INPUT_DIGITS_MAX];	/* [output] digits data, e.g { 1, 2, 3, 4, 5, 6, 7, 8 } */
} window_input_digits_s;

typedef struct {
	uint32_t	title_text;
	uint32_t	hint_text;
	uint32_t	hint_font_size;
	uint32_t	voice_id;

	uint32_t	type;	/* NUMBER_VALUE/NUMBER_DIGITS */
	union {
		window_input_value_s	value;
		window_input_digits_s	digits;
	} u;
	int	result;
} window_input_number_data_s;

#define WINDOW_INPUT_F_INIT_NULL	0x00
#define WINDOW_INPUT_F_FORCE_COMPLETE	0x01
#define WINDOW_INPUT_F_INIT_VALUE	0x02

typedef struct {
	uint32_t	title_text;
	uint32_t	hint_text;
	uint32_t	voice_id;

	uint32_t	flags;
	gkt_date_u	date;
	int	result;	/* COMPLETE or CANCELLED */
} window_input_date_s;


typedef struct {
	uint32_t	title_text;
	uint32_t	hint_text;
	uint32_t	voice_id;

	uint32_t	flags;
	gkt_time_u	time;
	int	result;	/* COMPLETE or CANCELLED */
} window_input_time_s;

#ifdef __cplusplus
}
#endif

#endif	/* WINDOW_INPUT_H */

